<?php

namespace App\Mail;

use App\Models\Admin;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class UserMessage extends Mailable
{
    use Queueable, SerializesModels;

    protected $_user;
    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(User $_user)
    {
        $this->_user = $_user;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->view('emails.notice')
                    ->subject('ECM系统账号密码邮件')
                    ->with([
                        'name' => $this->_user->name,
                        'password' => $this->_user->password,
                    ]);
    }
}
